|
CAN Gateway code example
v1.2
|
The main file of an example code for CAN Gateway with hdj2534.so (v1.0.226) More...
#include <iostream>#include <cstring>#include <unistd.h>#include <pthread.h>#include <hdj2534.h>#include "cangw.hpp"Go to the source code of this file.
Functions | |
| static void | rcvChannel1 (const J2534::PASSTHRU_MSG *rxPassThruMsg, unsigned long rxMsgNum) |
| Callback function for receive on channel 1. More... | |
| static void | rcvChannel2 (const J2534::PASSTHRU_MSG *rxPassThruMsg, unsigned long rxMsgNum) |
| Callback function for receive on channel 2. More... | |
| int | main () |
| The main function. | |
Variables | |
| static const unsigned int | MESSAGES_TO_SEND = 50 |
| Number of messages to send. | |
| static const unsigned int | PERIODIC_MSG_INTERVAL = 50 |
| Period for periodic messages. | |
| static const char | CHANNEL_1_MARK = '1' |
| Marking for messages sent over channel 1. | |
| static const char | CHANNEL_2_MARK = '2' |
| Marking for messages sent over channel 2. | |
| static const char | PERIODIC_MSG_MARK = 'P' |
| Marking for periodic messages. | |
| static pthread_mutex_t | screenMutex = PTHREAD_MUTEX_INITIALIZER |
| Mutex used by callback functions during accessing the screen. | |
The main file of an example code for CAN Gateway with hdj2534.so (v1.0.226)
Definition in file main.cpp.
|
static |
Callback function for receive on channel 1.
| [in] | rxPassThruMsg | Pointer to buffer with received messages |
| [in] | rxMsgNum | Number of received messages |
Definition at line 157 of file main.cpp.
References PERIODIC_MSG_MARK, and screenMutex.
Referenced by main().
|
static |
Callback function for receive on channel 2.
| [in] | rxPassThruMsg | Pointer to buffer with received messages |
| [in] | rxMsgNum | Number of received messages |
Definition at line 182 of file main.cpp.
References PERIODIC_MSG_MARK, and screenMutex.
Referenced by main().
1.8.6